package com.eshop.config;

import org.springframework.context.annotation.Bean;
import java.util.Properties;
import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class MybatisConfig
{
    @Bean
    public PageHelper pageHelper() {
        final PageHelper pageHelper = new PageHelper();
        final Properties properties = new Properties();
        properties.setProperty("offsetAsPageNum", "true");
        properties.setProperty("rowBoundsWithCount", "true");
        properties.setProperty("reasonable", "true");
        properties.setProperty("dialect", "mysql");
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
